// 默认主题详细配置
import themeJson from './global.theme.json'
import customed from './themes/customed.json'
import dark from './themes/dark.json'
import chalk from './themes/chalk.json'
import essos from './themes/essos.json'
import macarons from './themes/macarons.json'
import purplePassion from './themes/purple-passion.json'
import roma from './themes/roma.json'
import shine from './themes/shine.json'
import vintage from './themes/vintage.json'
import walden from './themes/walden.json'
import westeros from './themes/westeros.json'
import wonderland from './themes/wonderland.json'

export const chartColors = {
    dark,
    customed,
    macarons,
    walden,
    purplePassion,
    vintage,
    chalk,
    westeros,
    wonderland,
    essos,
    shine,
    roma
  }
  

// 主题色列表, 自定义的颜色使用的是 UUID 作为标识，因为两者数据结构不一致
export type ChartColorsNameType = keyof typeof chartColors

// 自定义颜色
export type CustomColorsType = {
  id: string,
  name: string,
  color: string[]
}

// 默认主题详细配置
type ThemeJsonType = typeof themeJson

export type EchartsRenderer = 'svg' | 'canvas';

export interface GlobalThemeJsonType extends Partial<ThemeJsonType> {
  dataset?: any,
  renderer?: EchartsRenderer,
  [T:string]: any
}

// 全局样式配置，数据未空，渲染未svg
export const globalThemeJson = {...themeJson, dataset: null, renderer: 'svg' as const }